<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/jquery.js"></script>
		<link rel="stylesheet" href="css/bootstrap.css">
		<script src="js/bootstrap.js"></script>
		<link rel="stylesheet" href="css/ol.css" type="text/css">
		<script src="js/ol-debug.js"></script>
	</head>

	<body>

		<div class="container-fluid">

			<div class="row-fluid">
				<div class="span12">
					<div id="map" class="map"></div>
				</div>
			</div>

			<script type="text/javascript">
				var map = new ol.Map({
					layers: [
						new ol.layer.Tile({
							source: new ol.source.OSM()
						}),
						new ol.layer.Vector({
							source: new ol.source.Vector({
								features: [new ol.Feature(
									/*new ol.geom.Polygon([
										[
											[-3e6, -1e6],
											[-3e6, 1e6],
											[-1e6, 1e6],
											[-1e6, -1e6],
											[-3e6, -1e6]
										]
									])*/
									new ol.geom.LineString([
										[-1e7, 1e6],
										[-1e6, 3e6]
									])
								)]
							}),
							style: [new ol.style.Style({
								stroke: new ol.style.Stroke({
									color: 'magenta',
									width: 2,
									//									lineGap:'round',
									//									lineJoin: 'miter',
									lineDash: [3],
									//									miterLimit:100
								})
							}),
							//如果指定了geometry，则该样式只适用于此geometry
							new ol.style.Style({
								stroke: new ol.style.Stroke({
									color: 'red',
									width: 2,
									//									lineGap:'round',
									//									lineJoin: 'miter',
									lineDash: [10],
									//									miterLimit:100
								}),
								fill: new ol.style.Fill({
									color: 'white'
								}),
								geometry: new ol.geom.Polygon([
									[
										[-3e6, -1e6],
										[-3e6, 1e6],
										[-1e6, 1e6],
										[-1e6, -1e6],
										[-3e6, -1e6]
									]
								])
							})
							]
						})
					],
					target: 'map',
					controls: ol.control.defaults({
						attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
							collapsible: false
						})
					}),
					view: new ol.View({
						center: [0, 0],
						zoom: 2
					})
				});
			</script>

		</div>

	</body>

</html>